package jp.dip.ysato.excitewidget;

import android.app.PendingIntent;
import android.appwidget.AppWidgetManager;
import android.appwidget.AppWidgetProvider;
import android.content.ComponentName;
import android.content.Context;
import android.content.Intent;
import android.util.Log;
import android.widget.RemoteViews;

public class ExciteWidget extends AppWidgetProvider {
	@Override
	public	void onUpdate(Context context, AppWidgetManager manager, int[] ids) {
		super.onUpdate(context, manager, ids);
		Intent intent = new Intent(context, ExciteService.class);
		context.startService(intent);
		intent = new Intent(context, DetailActivity.class);
		PendingIntent pi = PendingIntent.getActivity(context, 0, intent, 0);
		RemoteViews views = new RemoteViews(context.getPackageName(), R.layout.layout);
		views.setOnClickPendingIntent(R.id.widget, pi);
		ComponentName widget = new ComponentName(context, ExciteWidget.class);
		manager.updateAppWidget(widget, views);
	}
}
